/*
 * @copyright: Huang Ding
 * @Author: ding-cx
 * @Date: 2021-03-10 10:50:23
 * @LastEditors: ding-cx
 * @LastEditTime: 2021-04-03 08:54:50
 * @Description: file content
 */

import { EggApplication } from "egg";
import WsWorker from "../../lib/worker";

const cache = Symbol("Application#ws");
export default {
  get ws() {
    if (!this[cache]) {
      this[cache] = new WsWorker((this as unknown) as EggApplication);
    }
    return this[cache];
  },
};
